import Axios from '@/utils/request';
import { getUser } from '@/utils/user-util';

/**
 * 风控审核
 * @param operateType 操作类型; 自动刷新：autoRefresh，用户操作：userAction，为空请求时设置为userAction，用于设置系统日志类型
 * @returns
 */
export function getRiskApproval(operateType?: string): Promise<any> {
    const userCode = getUser()?.userCode
    let url = '/indexMonitor/riskApproval'
    if (userCode) {
        url = url + '/' + userCode
    }
    // return Axios.post('/indexMonitor/riskApproval');
    return Axios({ url, method: 'post', headers: { operateType: operateType } });
}

/**
 * 指标预警
 * @param operateType 操作类型; 自动刷新：autoRefresh，用户操作：userAction，为空请求时设置为userAction，用于设置系统日志类型
 * @returns
 */
export function getEntryWarning(operateType?: string): Promise<any> {
    // return Axios.post('/indexMonitor/entryWarning');
    return Axios({ url: '/indexMonitor/entryWarning', method: 'post', headers: { operateType: operateType } });
}
